<div class="page  has-sidebar-left height-full">
    <header class="blue accent-3 relative">
        <div class="container-fluid text-white">
            <div class="row p-t-b-10 ">
                <div class="col">
                    <h4>
                        <i class="icon-beenhere"></i>
                        Banner广告权限审核管理
                    </h4>
                </div>
            </div>
            <div class="row justify-content-between">
                <ul class="nav nav-material nav-material-white responsive-tab" id="v-pills-tab" role="tablist">
                    
                    
                    
                    
                <li>
                        <a class="nav-link"  href="{:url('banner/banner_switch_admin')}" ><i class="icon icon-credit-card"></i>待审核</a>
                    </li><li>
                        <a class="nav-link active " href="{:url('banner/banner_ok')}"><i class="icon icon-check-square-o"></i> 审核通过</a>
                    </li><li>
                        <a class="nav-link    " href="{:url('banner/banner_no')}"><i class="icon icon-not_interested"></i> 已拒绝</a>
                    </li></ul>
            </div>
        </div>
    </header>
  
  
    <div class="container-fluid animatedParent animateOnce">
        <div class="tab-content my-3">
            <div class="tab-pane animated fadeInUpShort show active go">
                <div class="row my-3">
                    <div class="col-md-12">
                      
                      
                      
                      
                      
                      
                      
                      <div class="card ">
                      
                      
                      <div class="card-body"><div class="card-body tab-pane step-content" style="display: block;">
                        <div class="card-title">广告权限 <span class=" btn btn-success   btn-xs  ">已通过</span> 用户列表 </div>
                  
                      
          <div class="sw-container tab-content">
            
            
                                     	 <form class="validate" method="get" action="{:url('banner/banner_switch_admin')}">
                                           <div class="form-row">
                                              <div class="form-group col-md-12 focused">  </div>
                                             
                                             
                                             
                                             <div class="form-group  col-md-12  focused">
                                               <input class="form-control form-control-lg" placeholder="&nbsp;账户 / 昵称"  type="text" name="key" placeholder="输入想检索的账户" >
                                           </div>
                                             
 											<input type="hidden" name="parentid" value="{$parentid}">

                                             
                                               <div class="form-group col-md-12 focused">
                                                  <button type="submit" onclick="dangetian()" class="btn btn-primary form-control form-control-lg">检索</button>
                                               </div>

     
                                           </div>
                                           
                                            </form>
                                     
                                     
                                     
                                     
                           

                  </div>
             
                        
                    </div>
                      
                      
                      
                      
                            <div class="table-responsive">
                              
                              
                                    <table class="table table-hover r-0">
                                        <thead>
                                        <tr class="no-b">
                                            <th>#</th>
                                            <th>昵称</th>
                                            <th>账户</th>
                                            <th>最后登陆时间</th>
                                            <th>会员到期时间</th>
       
                                            <th>上级</th>
  
                                            <th>余额</th>
                                            <th>下级代理</th>
                                            <th>下级用户</th>

                                            <th>开放权限</th>

                                            <th></th>
                                            <th></th>
                 
                                        </tr>
                                        </thead>

                                      
                                      
                                      
                                        <tbody>
                                          
                                          
                                          
                                         {volist name="list" id="vo"}
                                          <tr>
										<td> <small>{$vo.id}</small></td>

                                            
                                            
                                       <td> <small><span class="badge badge-light r-3">{$vo.nick_name}</span></small></td>

                                            <td> <small><span style="color: #03a9f4;">{$vo.username}</span></small></td>

                                            
                                            
                                            <td> <small><span class="badge badge-light"> <?php  if($vo['logintime']=='0')    {     echo '未登陆';   }else{     echo date('Y-m-d H:i:s',$vo['logintime']);   }   ?></span> </small></td>
                                            <td> <small>
                                 
                                <?php
                                if($vo['type']=='1')
                                {
                                echo '<span class=" btn btn-Secondary btn-xs  "> <i class="icon-beenhere "></i> 永久会员</span>';
                                }else{
                                if($vo['lasttime']=='0')
                                    {
                                        echo '<span class=" btn btn-Danger btn-xs  ">未充值</span>';
                                    }elseif($vo['lasttime']<time()){
                                        echo ' <span class=" btn btn-Warning btn-xs ">已于'.date('Y-m-d',$vo['lasttime']).'过期</span> <!--  <span style="color:red">'.date('Y-m-d H:i:s',$vo['lasttime']).'</span>-->';
                                }else{
                                echo       '<span class=" btn btn-Primary btn-xs  ">'.date('Y-m-d H:i:s',$vo['lasttime']).'</span>';
                                }
                                }

                                ?>
                                              </small></td>
                                            
                                
                                            
                                            <td> <small><?php echo $vo['parentid']=='0'?'暂无归属':gui($vo['parentid']) ?></small></td>
                                   
                                            
                                       <td> <small><span class="badge badge-light r-3">¥ {$vo.money}</span></small></td>
                                   
                                      
                                            
                                                                     <td>
                                <a href="/index/user/index/parentid/{$vo.id}"><small><span class="badge badge-light r-3"> {:getusercount($vo['id'])} </span></small></a>
                            </td>
                            <td>
                                <a  href="/index/vip/index/parentid/{$vo.id}"><small><span class="badge badge-light r-3"> {:getvipcount($vo['id'])}  </span></small></a>
                            </td>  
                                            
                                            
                                            
                                            
                                   
                                            
                                       <td> <small>    <span class="badge badge-primary r-3 shadow1 "> <i class="blink " style="font-weight:bold">{$vo.banner_number}</i> </span>  </small></td>
                                            
        
                                            
                                            
                                            
                                            <td> 
                                              <a href="{:url('banner/update_banner_switch_admin',['id'=>$vo['id']])}" title="处理">    <span class="  btn-fab btn-fab-sm shadow btn-success"><i class="icon icon-check"></i>      </span>    </a>
                                            </td>

                                           <td> 
                                			<a onclick="banner_switch_admin_no('{$vo.id}')" title="收回" >    <span class="  btn-fab btn-fab-sm shadow btn-Danger"><i class="icon icon-not_interested"></i>      </span>    </a>
             							 </td>  
                                            

                                            

                                            
                                        </tr>
								 {/volist}  
          
                                        
                                        

                                        </tbody>
                                    </table>

                            </div>        
                        </div>
                {$list->render()}
              
              </div>
         
          
                
            </div>

              
              
              
              

        </div>
    </div>
</div>
  


<?php if(session('power')=='0'){?>
<script>
    $("input[name='checkall']").click(function(){
//判断当前点击的复选框处于什么状态$(this).is(":checked") 返回的是布尔类型
        if($(this).is(":checked")){
            $("input[name='checkname']").prop("checked",true);
        }else{
            $("input[name='checkname']").prop("checked",false);
        }
    });
</script>
{$code==1?'
<div class="col-md-6" id="alert" style="position:fixed;right:0px;bottom:0px;  width: 350px">
    <div class="alert alert-success">
        <button type="button" class="close" data-dismiss="alert">
            <span aria-hidden="true">×</span>
            <span class="sr-only">Close</span>
        </button>

        <strong>恭喜 !</strong> 添加成功.
    </div>
</div>

':''}


{$code==2?'
<div class="col-md-6" id="alert" style="position:fixed;right:0px;bottom:0px;  width: 350px">
    <div class="alert alert-success">
        <button type="button" class="close" data-dismiss="alert">
            <span aria-hidden="true">×</span>
            <span class="sr-only">Close</span>
        </button>

        <strong>恭喜 !</strong> 修改成功.
    </div>
</div>

':''}



{$code=='err4'?'
<div class="col-md-6">
    <div class="alert alert-danger" id="alert" style="position:fixed;right:0px;bottom:0px;  width: 350px">
        <button type="button" class="close" data-dismiss="alert">
            <span aria-hidden="true">×</span>
            <span class="sr-only">Close</span>
        </button>
        <strong> 糟糕 !</strong> 推荐码已存在
        .请重新添加
    </div>
</div>

':''}



{$code==3?'
<div class="col-md-6" id="alert" style="position:fixed;right:0px;bottom:0px;  width: 350px">
    <div class="alert alert-success">
        <button type="button" class="close" data-dismiss="alert">
            <span aria-hidden="true">×</span>
            <span class="sr-only">Close</span>
        </button>

        <strong>恭喜 !</strong> 删除成功.
    </div>
</div>

':''}
<script>
    function banner_switch_admin_no(id){
        if(id=='') {
            var str = "";
            $("input:checkbox[name='checkname']:checked").each(function () {
                str += $(this).val() + ",";
            });

            if (str == '') {
                return false
            }
        }else{
            var str     =   id
        }
        layer.confirm('您是否删除该数据', {
            btn: ['确定','取消'] //按钮
        }, function(){
            $.ajax({
                'type'  :   'post',
                'url'   :   '{:url("banner/banner_switch_admin_no")}',
                'data'  :   {
                    'id'    :   str
                },
                'dataType'  :   'json',
                'success'   :   function (msg)
                {
                    if(msg.code=='1')
                    {
                        window.location.reload();
                    }else{
                        layer.closeAll();
                        $('#del').php('<div class="col-md-6" id="alert">' +
                            '<div class="alert alert-danger"  style="position:fixed;right:0px;bottom:0px;  width: 350px">' +
                            ' <button type="button" class="close" data-dismiss="alert">' +
                            '<span aria-hidden="true">×</span>' +
                            '<span class="sr-only">Close</span>' +
                            '</button>' +
                            '<strong> 糟糕 !</strong> 删除失败'+
                            '.请刷新后重试' +
                            '</div>' +
                            '</div>');
                    }


                    layer.closeAll();
                    setTimeout("$('#alert').fadeOut(1000)", 2000)
                },
                'error'     :   function (err)
                {
                    layer.closeAll();
                    $('#del').php('<div class="col-md-6" id="alert">' +
                        '<div class="alert alert-danger"  style="position:fixed;right:0px;bottom:0px;  width: 350px">' +
                        ' <button type="button" class="close" data-dismiss="alert">' +
                        '<span aria-hidden="true">×</span>' +
                        '<span class="sr-only">Close</span>' +
                        '</button>' +
                        '<strong> 糟糕 !</strong> 服务器错误'+
                        '.请刷新后重试' +
                        '</div>' +
                        '</div>');
                    setTimeout("yalert()", 2000)
                }
            })
        })

    }
    function yalert() {

        $('#alert').fadeOut(1000);
        $('#alert').remove()
    }

</script>






<?php }?>




<script>
    setTimeout("$('#alert').fadeOut(1000)", 2000)
</script>
<div id="del">

</div>